#include "stddef.h"
#include "string.h"
#include "cpuid.h"

/* memchr(): Returns pointer to first occurrence of c in first n characters of cs, or NULL if not found. */
void * memchr(const void * cs, const int c, const size_t n)
{
	size_t i;

	for(i = 0; i < n; i++)
	{
		if(*(uint8_t*)(((size_t)cs) + i) == (uint8_t)c)
		{ return (void *)(((size_t)cs) + i); }
	}

	return (void *)NULL;
}